home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr51
/
tag_utes.zip
/
LISTDBFS.PRG
next >
Wrap
Text File
|
1993-04-01
|
3KB
|
67 lines
PROCEDURE ListDbfs
*-------------------------------------------------------------------------------
*-- Programmer..: David Love (DAVIDLOVE)
*-- Date........: 01/31/1992
*-- Notes.......: This procedure will create a list of the database (.dbf) files
*-- in the current directory. It will create a database file
*-- named Dbfs.dbf which exists of one 12-character field--Dbf.
*-- It will also create a text file, Dbfs.txt, through the
*-- LIST FILES TO FILE command. Then it will append records
*-- to the Dbfs.dbf file and erase the Dbfs.txt file.
*-- : This Dbfs.dbf file can be SCANned, or used in a POPUP PROMPT
*-- FIELD command, or in any way that you can imagine.
*-- : The file 'Dbfs.dbf' will not be included in the Dbfs.dbf file.
*-- WARNING===> : If your application includes a file with the name of
*-- 'Dbfs.dbf', it will be overwritten with the file created
*-- by this procedure.
*-- Written for.: dBASE IV, 1.1
*-- Rev. History:
*-- Calls.......: None
*-- Called by...: Any
*-- Usage.......: do ListDbfs
*-- Returns.....: None
*-- Parameters..: None
*-- Acknowledgement..: Bowen Moursund for the code that creates Dbfs.dbf
*-- (Download PRGCREAT.ZIP for more info.)
*-------------------------------------------------------------------------------
PRIVATE cConsole
*-- Write the directory of dbf files to a text file (Dbfs.txt)
*-- First, erase the file if it exists
IF FILE("Dbfs.txt")
ERASE dbfs.txt
ENDIF
*-- And, erase the dbfs.dbf file if it exists (so won't be included
*-- in the list)
IF FILE("Dbfs.dbf")
ERASE Dbfs.dbf
ENDIF
*-- Now, write the dbfs.txt file
cConsole = SET("CONSOLE")
SET CONSOLE OFF
LIST FILES TO FILE dbfs.txt
SET CONSOLE &cConsole.
*-- Then, create the file DBFS.DBF
SET PRINTER TO FILE DBFS.DBF
SET PRINTER ON
??? "{3}{92}{2}{1}{0}{0}{0}{0}{65}{0}{13}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}"+;
"{0}{0}{0}{0}{0}{0}{0}{0}{89}{0}{68}{66}{70}{0}{0}{0}{0}{0}{0}{0}{0}{67}{3}"+;
"{0}{44}{85}{12}{0}{0}{0}{1}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{0}{13}{26}"
SET PRINTER TO
SET PRINTER OFF
*-- Now, append dbfs.txt to dbfs.dbf if the record is a dbf listing.
USE Dbfs
APPEND FROM Dbfs.txt FOR ".DBF" $ Dbf TYPE SDF
USE && can remove this command if you want
ERASE Dbfs.txt && don't need it anymore
RETURN
*--EOP: Listdbfs.prg